package com.songshuai.webapi.crm.feign;

import com.songshuai.webapi.baseapi.dto.feign.response.DictionaryDto;
import com.songshuai.webapi.baseapi.dto.feign.response.MasterSourceItemDto;
import com.songshuai.webapi.baseapi.pojo.QueryResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;

@FeignClient(value = "base-api")
public interface BaseDictionaryClient {

    /**
     * 根据Type获取字典信息
     * @param typeId
     * @return
     */
    @RequestMapping(value = "/api/dictionary/getDictionaryByType", method = RequestMethod.GET)
    QueryResponse<List<DictionaryDto>> getDictionaryByType(@RequestParam("typeId") Integer typeId);

    /**
     * 根据Id获取来源
     * @param id
     * @return
     */
    @GetMapping("/api/mastersource/querySourceById")
    QueryResponse<MasterSourceItemDto> querySourceById(@RequestParam("id") Integer id);

    /**
     * 获取所有来源
     * @return
     */
    @GetMapping("/api/mastersource/querySourceList")
    QueryResponse<List<MasterSourceItemDto>> queryMasterSourceList();

}

